package impl;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import dao.xsdao;
import entiy.XsXx;
import uitl.Alipool;


public class xsimpl implements xsdao{

	@Override
	public List<XsXx> getfy2() throws SQLException {
		String sql="SELECT  * FROM  bjbiao";
		Connection conn =Alipool.getconn();
		PreparedStatement pt = conn.prepareStatement(sql);
		
		ResultSet rs=pt. executeQuery(); 
		List<XsXx> list=new ArrayList<XsXx>();
		while(rs.next()){
			int bjID=rs.getInt(1);
			String bjxmName=rs.getString(2);
			String	bzr=rs.getString(3);
			 	
		XsXx p=new XsXx(bjID, bjxmName, bzr);
			list.add(p);
	}
		conn.close();
		return list;
	}
public static void main(String[] args) throws SQLException {
	xsdao udao=new xsimpl();
	List<XsXx> litu=null;
	
		 litu=udao.getfy2();
	
		
	System.out.println(litu);
}
	
}
